<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>MiXiM: TurtleMobility Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">MiXiM
   &#160;<span id="projectnumber">2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('a00220.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a>  </div>
  <div class="headertitle">
<div class="title">TurtleMobility Class Reference<div class="ingroups"><a class="el" href="a00513.html">mobility - modules handling the mobility of the hosts</a></div></div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="TurtleMobility" --><!-- doxytag: inherits="LineSegmentsMobilityBase" -->
<p>LOGO-style movement model, with the script coming from XML. See NED file for more info.  
 <a href="a00220.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="a00385_source.html">TurtleMobility.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for TurtleMobility:</div>
<div class="dyncontent">
<div class="center"><img src="a01054.png" border="0" usemap="#TurtleMobility_inherit__map" alt="Inheritance graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for TurtleMobility:</div>
<div class="dyncontent">
<div class="center"><img src="a01055.png" border="0" usemap="#TurtleMobility_coll__map" alt="Collaboration graph"/></div>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="a01056.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6f15f0b51441338a3e828135d598c1a5"></a><!-- doxytag: member="TurtleMobility::initialize" ref="a6f15f0b51441338a3e828135d598c1a5" args="(int stage)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#a6f15f0b51441338a3e828135d598c1a5">initialize</a> (int stage)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes mobility model parameters. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae89831a398a71d6472c26f336887f754"></a><!-- doxytag: member="TurtleMobility::initializePosition" ref="ae89831a398a71d6472c26f336887f754" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#ae89831a398a71d6472c26f336887f754">initializePosition</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the position according to the mobility model. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77b7dc906cdb7ac02ee420a4a8028ac9"></a><!-- doxytag: member="TurtleMobility::setTargetPosition" ref="a77b7dc906cdb7ac02ee420a4a8028ac9" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#a77b7dc906cdb7ac02ee420a4a8028ac9">setTargetPosition</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Overridden from <a class="el" href="a00124.html" title="Base class for mobility models where movement consists of a sequence of linear movements of constant ...">LineSegmentsMobilityBase</a>. Invokes <a class="el" href="a00220.html#a6301ae69ac2657ffb813f422885b4323" title="Process next statements from script.">resumeScript()</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aca27a0cc6248eaad99c566d49c2ffc5e"></a><!-- doxytag: member="TurtleMobility::move" ref="aca27a0cc6248eaad99c566d49c2ffc5e" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#aca27a0cc6248eaad99c566d49c2ffc5e">move</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Overridden from <a class="el" href="a00124.html" title="Base class for mobility models where movement consists of a sequence of linear movements of constant ...">LineSegmentsMobilityBase</a>. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#a6301ae69ac2657ffb813f422885b4323">resumeScript</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Process next statements from script.  <a href="#a6301ae69ac2657ffb813f422885b4323"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf8a33f548f1f30804b8e8399b7f0dfd"></a><!-- doxytag: member="TurtleMobility::executeStatement" ref="adf8a33f548f1f30804b8e8399b7f0dfd" args="(cXMLElement *nextStatement)" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#adf8a33f548f1f30804b8e8399b7f0dfd">executeStatement</a> (cXMLElement *nextStatement)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute the given statement. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9139ae0504735451c6767415f1951992"></a><!-- doxytag: member="TurtleMobility::getValue" ref="a9139ae0504735451c6767415f1951992" args="(const char *s)" -->
virtual double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#a9139ae0504735451c6767415f1951992">getValue</a> (const char *s)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse attrs in the script -- accepts things like "uniform(10,50) as well. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a999d116108ecc399eae6aaca63a45bcf"></a><!-- doxytag: member="TurtleMobility::gotoNextStatement" ref="a999d116108ecc399eae6aaca63a45bcf" args="()" -->
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00220.html#a999d116108ecc399eae6aaca63a45bcf">gotoNextStatement</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Advance nextStatement pointer. <br/></td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a08babee46db12aad334943374937962b"></a><!-- doxytag: member="TurtleMobility::turtleScript" ref="a08babee46db12aad334943374937962b" args="" -->
cXMLElement *&#160;</td><td class="memItemRight" valign="bottom"><b>turtleScript</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aadb591a9cc96eb64acde49644c45805b"></a><!-- doxytag: member="TurtleMobility::nextStatement" ref="aadb591a9cc96eb64acde49644c45805b" args="" -->
cXMLElement *&#160;</td><td class="memItemRight" valign="bottom"><b>nextStatement</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0369b5e57db118aba35e9a116203eb4d"></a><!-- doxytag: member="TurtleMobility::speed" ref="a0369b5e57db118aba35e9a116203eb4d" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>speed</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8e8e4dc8443ca6866b5540b3005e7b24"></a><!-- doxytag: member="TurtleMobility::angle" ref="a8e8e4dc8443ca6866b5540b3005e7b24" args="" -->
double&#160;</td><td class="memItemRight" valign="bottom"><b>angle</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae43798eb0dd7cb1e08eba3350edc46fc"></a><!-- doxytag: member="TurtleMobility::borderPolicy" ref="ae43798eb0dd7cb1e08eba3350edc46fc" args="" -->
<a class="el" href="a00145.html#aa67dcad3ed1e7fe0164b84131aea2b18">BorderPolicy</a>&#160;</td><td class="memItemRight" valign="bottom"><b>borderPolicy</b></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac46a272d9b3a0d28684e4ea3ea675cbc"></a><!-- doxytag: member="TurtleMobility::loopVars" ref="ac46a272d9b3a0d28684e4ea3ea675cbc" args="" -->
std::stack&lt; long &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>loopVars</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>LOGO-style movement model, with the script coming from XML. See NED file for more info. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>Andras Varga </dd></dl>
</div><hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a6301ae69ac2657ffb813f422885b4323"></a><!-- doxytag: member="TurtleMobility::resumeScript" ref="a6301ae69ac2657ffb813f422885b4323" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TurtleMobility::resumeScript </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Process next statements from script. </p>
<p>Will set a new nextChange and targetPosition. </p>

<p>References <a class="el" href="a00220.html#adf8a33f548f1f30804b8e8399b7f0dfd">executeStatement()</a>, <a class="el" href="a00220.html#a999d116108ecc399eae6aaca63a45bcf">gotoNextStatement()</a>, <a class="el" href="a00145.html#a82ae637969433a492154b26039b84038">MobilityBase::lastPosition</a>, <a class="el" href="a00147.html#a5c6e51e3ac03c935482057ce7726eb3d">MovingMobilityBase::nextChange</a>, <a class="el" href="a00147.html#a6c780988c5edd64fc81a7a4d342b8118">MovingMobilityBase::stationary</a>, and <a class="el" href="a00124.html#acf4b064a5f64a5bc493e497c1cf134ac">LineSegmentsMobilityBase::targetPosition</a>.</p>

<p>Referenced by <a class="el" href="a00220.html#ae89831a398a71d6472c26f336887f754">initializePosition()</a>, and <a class="el" href="a00220.html#a77b7dc906cdb7ac02ee420a4a8028ac9">setTargetPosition()</a>.</p>
<div class="fragment"><pre class="fragment">{
    simtime_t now = simTime();

    <span class="keywordflow">do</span> {
        <span class="keywordflow">if</span> (nextStatement != NULL)
        {
            <a class="code" href="a00220.html#adf8a33f548f1f30804b8e8399b7f0dfd" title="Execute the given statement.">executeStatement</a>(nextStatement);
            <a class="code" href="a00220.html#a999d116108ecc399eae6aaca63a45bcf" title="Advance nextStatement pointer.">gotoNextStatement</a>();
        }
        <span class="keywordflow">else</span>
        {
            <a class="code" href="a00147.html#a5c6e51e3ac03c935482057ce7726eb3d" title="The next simulation time when the mobility module needs to update its internal state.">nextChange</a> = -1;
            <a class="code" href="a00147.html#a6c780988c5edd64fc81a7a4d342b8118" title="A mobility model may decide to become stationary at any time.">stationary</a> = <span class="keyword">true</span>;
            <a class="code" href="a00124.html#acf4b064a5f64a5bc493e497c1cf134ac" title="End position of current linear movement.">targetPosition</a> = <a class="code" href="a00145.html#a82ae637969433a492154b26039b84038" title="The last position that was reported.">lastPosition</a>;
        }
    } <span class="keywordflow">while</span> (<a class="code" href="a00147.html#a5c6e51e3ac03c935482057ce7726eb3d" title="The next simulation time when the mobility module needs to update its internal state.">nextChange</a> == now);
}
</pre></div>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>D:/Projects/MiXiM/extsrc/mixim/src/inet_stub/mobility/models/<a class="el" href="a00385_source.html">TurtleMobility.h</a></li>
<li>D:/Projects/MiXiM/extsrc/mixim/src/inet_stub/mobility/models/TurtleMobility.cc</li>
</ul>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="a00220.html">TurtleMobility</a>      </li>

    <li class="footer">Generated on Tue Mar 5 2013 21:26:33 for MiXiM by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
